<?php

	class Controller_Games extends Controller_Base
	{
		function index()
		{
			$this->assignData('games', WebApp::app()->db->select(array('*'),array('games')));
		}
		function view()
		{
			$this->assignData('isAuth', Autorization::isAuth());
			$id_games =  WebApp::app()->db->select(array('id'), array('games'), "name ='".$this->args[0]."'");
			$id_games = $id_games[0]->id;
			//echo $this->args[0];
			//exit;
			$rez = WebApp::app()->db->select(array('albums.id', 'albums.title'),array('albums'),
			"albums.game_id = ".$id_games);
			$this->assignData('albums_cat', $rez);
		}
		
	}

?>